/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.base.manager.impl;

import com.xy.biz.base.dao.GoodsBatchDao;
import com.xy.biz.base.domain.bo.GoodsBatchBO;
import com.xy.biz.base.domain.converter.GoodsBatchConverter;
import com.xy.biz.base.domain.query.GoodsBatchQuery;
import com.xy.biz.base.manager.GoodsBatchManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 *
 *
 * @author zgy
 * @date 2021-9-22
 */
@Service
public class GoodsBatchManagerImpl implements GoodsBatchManager {

	@Autowired
	private GoodsBatchDao goodsBatchDao;

	@Override
	public int saveGoodsBatch(GoodsBatchBO goodsBatchBO) {
		return goodsBatchDao.saveGoodsBatch(GoodsBatchConverter.toPO(goodsBatchBO));
	}

	@Override
	public int saveAllGoodsBatch(Collection<GoodsBatchBO> collection) {
		return goodsBatchDao.saveAllGoodsBatch(GoodsBatchConverter.toPO(collection));
	}

	@Override
	public int updateGoodsBatch(GoodsBatchBO goodsBatchBO) {
		return goodsBatchDao.updateGoodsBatch(GoodsBatchConverter.toPO(goodsBatchBO));
	}

	@Override
	public int deleteGoodsBatch(Long goodsBatchId) {
		return goodsBatchDao.deleteGoodsBatch(goodsBatchId);
	}

	@Override
	public GoodsBatchBO getGoodsBatch(Long goodsBatchId) {
		return GoodsBatchConverter.fromPO(goodsBatchDao.getGoodsBatch(goodsBatchId));
	}

	@Override
	public List<GoodsBatchBO> listGoodsBatchById(Collection<Long> collection) {
		return GoodsBatchConverter.fromPO(goodsBatchDao.listGoodsBatchById(collection));
	}

	@Override
	public List<GoodsBatchBO> listGoodsBatchByGoods(GoodsBatchQuery query) {
		return GoodsBatchConverter.fromPO(goodsBatchDao.listGoodsBatchByGoods(query));
	}

	@Override
	public List<GoodsBatchBO> listGoodsBatchByGoodsAndBatch(Collection<GoodsBatchQuery> queryCollection) {
		return GoodsBatchConverter.fromPO(goodsBatchDao.listGoodsBatchByGoodsAndBatch(queryCollection));
	}

	@Override
	public List<GoodsBatchBO> listGoodsBatch(GoodsBatchQuery query) {
		return GoodsBatchConverter.fromPO(goodsBatchDao.listGoodsBatch(query));
	}

	@Override
	public int countGoodsBatch(GoodsBatchQuery query) {
		return goodsBatchDao.countGoodsBatch(query);
	}

}
